[WPF]ItemsControl not completely loaded @Loaded event
Posted
by Kaare
on Stack Overflow
See other posts from Stack Overflow
or by Kaare
Published on 2009-10-20T08:53:30Z
Indexed on
2010/05/17
9:20 UTC
Read the original article
Hit count: 457
Hi everyone
I have a propably simple problem, that i just can't seem to figure out:
I've made an ItemsControl which has its datacontext set and shows the data as pairs of Checkboxes and TextBlocs:
<ItemsControl Name="listTaskTypes" Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" ItemsSource="{Binding}" Margin="10,0,0,0" VerticalAlignment="Top" Loaded="listTaskTypes_Loaded">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Name="checkBoxTypeId" Tag="{Binding Path=TaskTypeID}"/>
<TextBlock FontSize="11pt" FontFamily="Helvetica" Text="{Binding Path=Text}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
My problem is that in the Loaded event of the ItemsControl, the checkboxes does not exist yet. How can i get an event when the ItemsControl is completely loaded or is this not possible?
© Stack Overflow or respective owner